<%--
  Created by IntelliJ IDEA.
  User: Fan
  Date: 2016/9/27
  Time: 21:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>用户登录</title>
    <style type="text/css">
        body{
            background-image: url(../images/background.jpg);
            /*background-repeat: repeat-x;*/
            background-size:cover;
        }
        #back{

            float: left;
            margin-left: 70px;
        }
        #forward{
            float: right;
            margin-right: 70px;
        }
        .bottom{
            position: absolute;
            bottom: 50px;
            left: 0;
            height: 20px;
            width: 100%;
        }
    </style>
    <script type="text/javascript">
        var reg = /^0?1[3|4|5|8][0-9]\d{8}$/;
        function login(form) {
            if (form.phone.value == "") {
                alert("用户不能为空！");
                return false;
            }
            if(!reg.test(form.phone.value)){
                alert("请确认11位手机号");
                return false;
            }
            if (form.password.value == "") {
                alert("密码不能为空！");
                return false;
            }
        }
    </script>
</head>

<body>
<ul>
    <li><a href="UserReg.jsp">用户注册</a></li>
</ul>
    <form action="${pageContext.request.contextPath}/UserLoginServlet" method="post"
          onSubmit="return login(this);">
        <table align="center" width="300" border="0" class="tb1">
            <tr>
                <td align="right">用户名：</td>
                <td><input type="text" name="phone"></td>
            </tr>
            <tr>
                <td align="right">密 码：</td>
                <td><input type="password" name="password"></td>
            </tr>
            <tr>
                <td colspan="2" align="center" height="50"><input type="submit"
                                                                  value="登 录"> <input type="reset" value="重 置"></td>
            </tr>
        </table>
    </form>
<input type="button" value="管理员" style="float: right; margin-right: 3px;"  onclick="window.location.href='/admin/AdminLogin.jsp'">
<div class="bottom"><img id="back" src="/images/arrow_left_24x24.png" onclick="window.history.back()"><img id="forward" src="/images/arrow_right_24x24.png" onclick="window.history.forward()"></div>
</body>
</html>
